﻿using CMWVS.Core.Mono;

namespace CMWVS.Core
{
    public class Application
    {
        public Application()
        {
            this.Resolver = new Resolver();
        }

        public void RegisterDefaults()
        {
            this.Resolver.Register<MonoConfig>(MonoConfigCreator.Create());
        }

        public Resolver Resolver
        {
            get;
            private set;
        }

        private MainViewModel m_MainViewModel;

        public MainViewModel MainViewModel
        {
            get
            {
                if (null == m_MainViewModel)
                {
                    MonoConfig monoConfig = this.Resolver.Get<MonoConfig>();
                    m_MainViewModel = new MainViewModel(monoConfig);
                }
                return m_MainViewModel;
            }
        }
    }
}